package com.hackintosh.factory.method.bike;

import javax.swing.*;
import java.awt.*;

/**
 * @description：
 * @author：twislyn
 * @date：Created in 2021/05/09
 * @modified By：
 * @version: 1.0
 */
public class YadeaBicycle implements Bicycle {
    JScrollPane sp;
    JFrame jFrame = new JFrame("工厂方法模式测试");

    public YadeaBicycle(){
        JPanel panel = new JPanel();
        panel.setLayout(new GridLayout(1,2));
        panel.setBorder(BorderFactory.createTitledBorder("雅迪电动车"));
        JLabel jLabel = new JLabel(new ImageIcon(this.getClass().getClassLoader().getResource("YadeaBicycle.jpg")));
        panel.add(jLabel);
        Container container = jFrame.getContentPane();
        sp = new JScrollPane(panel);
        container.add(sp);
        jFrame.pack();
        jFrame.setVisible(false);
        jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    }

    @Override
    public void show() {
        jFrame.setVisible(true);
    }
}
